package com.ld.control.business.equipment.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ld.control.business.equipment.model.EquipmentModel;
import com.ld.control.business.equipment.vo.resp.EquipmentRespVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 设备表 Mapper 接口
 * </p>
 *
 * @author wangfeng
 * @since 2024-04-17
 */
public interface EquipmentMapper extends BaseMapper<EquipmentModel> {

    /**
     * 根据id更新删除标识
     * @param id
     * @return
     */
    int updateDelFlagById(@Param("id") Long id);

    IPage<EquipmentRespVo> selectPageList(IPage<EquipmentRespVo> iPage, @Param("regionId") Long regionId, @Param("name") String name,
                                          @Param("code") String code, @Param("status") Integer status, @Param("useFlag") Integer useFlag);

    /**
     * 查询某个任务实例下所有设备
     * @param taskExampleId
     * @return
     */
    List<EquipmentRespVo> selectListByTaskExampleId(@Param("taskExampleId") Long taskExampleId);

    /**
     * 查询某个任务实例下面有runMethod的设备
     * @param taskExampleId
     * @return
     */
    List<EquipmentRespVo> selectListByTaskExampleIdRunMethod(@Param("taskExampleId") Long taskExampleId);

    List<EquipmentRespVo> selectAllList();

}
